home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 34.zip
/
BS1 part 34
/
FredFish PD 314.adf
/
Zc
/
zcsrc.lzh
/
IOLib
/
stdio
/
gets.c
< prev
next >
Wrap
C/C++ Source or Header
|
1988-11-09
|
322b
|
22 lines
#include <stdio.h>
char *gets(data)
register char *data;
{
register char *p = data;
register int c;
while(((c = fgetc(stdin)) != EOF) && (c != '\n'))
{
if(c == '\b')
{
if(p > data)
--p;
}
else
*p++ = c;
}
*p = '\0';
return(((c == EOF) && (p == data)) ? NULL : data); /* NULL == EOF */
}